home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
shells
/
kiss-0.11
/
kiss-0
/
kiss
/
src
/
expandtilde.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-23
|
421b
|
27 lines
#include "kiss.h"
void expandtilde (Stringstack s)
{
char
buf [FILENAMELEN],
rest [FILENAMELEN];
register char
*cp;
register int
i;
for (i = 1; i < s.nstr; i++)
{
strcpy (buf, s.str [i]);
while ( (cp = strstr (buf, "~/")) )
{
strcpy (rest, cp + 2);
strcpy (cp, homedir);
strcat (buf, "/");
strcat (buf, rest);
}
free (s.str [i]);
s.str [i] = xstrdup (buf);
}
}